-
Notifications
You must be signed in to change notification settings - Fork 67
fix(mcp): Handle empty config dicts in validate_config #804
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Change condition from 'if config' to 'if config is not None' - Fixes issue where empty config dicts {} were treated as falsy - Resolves AirbyteConnectorConfigurationMissingError for declarative connectors Fixes #803 Co-Authored-By: AJ Steers <[email protected]>
Original prompt from AJ Steers
|
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
👋 Greetings, Airbyte Team Member!Here are some helpful tips and reminders for your convenience. Testing This PyAirbyte VersionYou can test this version of PyAirbyte using the following: # Run PyAirbyte CLI from this branch:
uvx --from 'git+https://github.com/airbytehq/PyAirbyte.git@devin/1758859067-fix-mcp-config-validation' pyairbyte --help
# Install PyAirbyte from this branch for development:
pip install 'git+https://github.com/airbytehq/PyAirbyte.git@devin/1758859067-fix-mcp-config-validation' Helpful ResourcesPR Slash CommandsAirbyte Maintainers can execute the following slash commands on your PR:
Community SupportQuestions? Join the #pyairbyte channel in our Slack workspace. |
📝 WalkthroughWalkthroughAdjusted validate_config in airbyte/_connector_base.py to treat any non-None config (including empty dict) as provided, preventing fallback to secret-manager hydration. No public API signatures changed. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Caller as Caller
participant Connector as Connector.validate_config
participant Secrets as Secret Manager
Caller->>Connector: validate_config(config)
alt config is None
Connector->>Secrets: hydrate_config_from_secret_manager()
Secrets-->>Connector: hydrated_config or error
else config is not None (incl. {})
Note right of Connector: Use provided config as-is
end
Connector-->>Caller: validation result / raises if missing
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🧬 Code graph analysis (1)airbyte/_connector_base.py (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
🔇 Additional comments (1)
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal). Please share your feedback with us on this Discord post. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
fix(mcp): Handle empty config dicts in validate_config
Summary
Fixes a bug in PyAirbyte MCP's
sync_source_to_cache
tool that was failing withAirbyteConnectorConfigurationMissingError
for declarative connectors with empty config specifications.The root cause was in
validate_config()
whereif config
treated empty dicts{}
as falsy, causing fallback toself._hydrated_config
before the config was actually set. Changed toif config is not None
to properly distinguish between "no config provided" vs "empty config provided".Review & Testing Checklist for Human
sync_source_to_cache
with a declarative connector (e.g., Rick & Morty) to verify the complete workflow now worksvalidate_config()
method to ensure this change doesn't break existing workflowsNone
,{}
, and populated config dicts in various scenariosNotes
None
and empty containersLink to Devin run: https://app.devin.ai/sessions/f328e253bb424c01b30b3b9701682da7
Requested by: @aaronsteers
Fixes #803
Summary by CodeRabbit